package com.dems.web;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dems.dao.RepairDao;
import com.dems.dao.StudentDao;
import com.dems.domain.Student;


@WebServlet("/UpdateRepairServlet")
public class UpdateRepairServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private RepairDao repairDao = new RepairDao();
    /**
     * @see HttpServlet#HttpServlet()
     */
    public UpdateRepairServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取参数
        String accountId = request.getParameter("accountId");
        String studentName = request.getParameter("studentName");
        String studentPassword = request.getParameter("studentPassword");
        String studentDormitory = request.getParameter("studentDormitory");
        String studentPhone = request.getParameter("studentPhone");
        Student student = new Student();
        student.setStudentNum(accountId);
        student.setStudentName(studentName);
        student.setStudentPassword(studentPassword);
        student.setStudentDormitory(studentDormitory);;
        student.setStudentPhone(studentPhone);
        StudentDao sd = new StudentDao();
        sd.update(student);
    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

}

